package com.sskj.common.box.imageloader;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.load.DecodeFormat;
import com.bumptech.glide.request.RequestOptions;
import com.sskj.common.base.App;
import com.sskj.common.base.GlideApp;
import com.sskj.common.box.glidetransform.GlideRoundTransformCenterCrop;
import com.youth.banner.loader.ImageLoader;

/**
 * 作者 :吕志豪
 * 简书：https://www.jianshu.com/u/6e525b929aac
 * github：https://github.com/lvzhihao100
 * 描述：
 * 创建时间：2018-08-08 09:09
 */
public class GlideRoundImageLoader extends ImageLoader {
    public GlideRoundImageLoader() {
    }
    private static RequestOptions optionsRound;

    static {
        optionsRound = new RequestOptions().format(DecodeFormat.PREFER_ARGB_8888).transform(new GlideRoundTransformCenterCrop(20));
    }
    @Override
    public void displayImage(Context context, Object path, ImageView imageView) {
        GlideApp.with(App.INSTANCE).load(path).apply(optionsRound).into(imageView);
    }
}